//管理所有的请求的文件
import instance from './request';

//首页数据请求
export function getIndexList() {
    return instance.get('/index/index');
}
//分类页数据请求
export function getCategoryList() {
    return instance.get('/catalog/index');
}

// 获取当前分类数据
export function GetFenleiDataApi(params) {
    return instance.get('/catalog/current', { params });
}
//删除历史记录
export function Clearhistory(params) {
    return instance({
        url: '/search/clearhistory',
        method: 'post',
        data: params,
    });
}

//实时搜索
export function getSearchHelper(params) {
    return instance.get('/search/helper', { params });
}

// 搜索页数据接口
export function getGoodList(params) {
    return instance.get('/goods/list', {
        params: params,
    });
}
// 2.搜索页 SearchPopup
// 历史记录列表和热门搜索列表
export function GetPopupData(params) {
    return instance({
        url: '/search/index',
        method: 'get',
        params: params,
    });
}
//7.购物车页 Cart
// 购物车列表
export function getCartList(params) {
    return instance({
        url: '/cart/index',
        method: 'get',
        params,
    });
}
//8.我的页面 User
//登陆
export function GoLogin(params) {
    return instance({
        url: '/auth/loginByWeb',
        method: 'post',
        data: params,
    });
}
// 详情页
export function getGoodDetail(params) {
    return instance.get('/goods/detail', {
        params: params,
    });
}
// 数据页列表;
export function getGoodRelated(params) {
    return instance.get('/goods/related', {
        params: params,
    });
}
// 专题页数据接口
export function getTopicList(params) {
    return instance.get('/topic/list', {
        params: params,
    });
}
